< previous page page_719 next page >

Page 719
Variable Data Type Prefixes
Table A.6 defines the standard variable data types in Visual Basic. These prefixes should be used when naming the variables in your program. Avoid the use of the Visual Basic suffixes (%, &, #, and so on) at all costs.
Table A.6 Variable Type Prefixes.
PrefixData TypeStorageExample
boolBooleanTwo bytesboolPerform
bytByteOne bytebyteArray
curCurrencyEight bytescurSales
intIntegerTwo bytesintLoop
dblDoubleEight bytesdblValue
dtDate and TimeEight bytesdtEntered
lngLongFour byteslngEnv
sglSingleFour bytessglValue
strStringOne byte per charstrName
vntVariantSixteen bytes plus one byte for each character in a string type vntAnything
aArrayDepends on sizeastrName
typUser-defined typeDepends on sizetypCustomer
o or objObjectsAny objectOConn

Scope Prefixes
A variables scope refers to the locations within your application that a particular variable may be read or modified. For example, a local variable is one declared within a Sub...End Sub or Function...End Function. This variable may only be read or modified while code is executing within the Sub...End Sub statements. A module-level variable, on the other hand, may be read and modified from any procedure or function within the same module. Global or public variables may be referenced from any procedure or function within the same project. Table A.7 lists the common scope prefixes you should use.

 
< previous page page_719 next page >

If you like this book, buy it!